package com.gt.utils;

import java.net.InetAddress;

public class LocalIp {

    /**
     * 获取服务器IP地址
     * @return
     */
    public static String  getServerIp() {
        try {
            return InetAddress.getLocalHost().getHostAddress();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public static void main(String[] args) {
        System.out.println(getServerIp());
    }
}
